package com.mti;

import java.util.List;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class ForecastConditionActivity extends Activity {
	ListView lvListe;

	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
		setContentView(R.layout.forecast_condition);
		
		lvListe = (ListView)findViewById(R.id.lvListe);
		
		if (GiveMeWeatherActivity.getHomeCityWeather() == null) {
			String[] listeStrings = {"Oops, nothing to show."};
			lvListe.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,listeStrings));
			return;
		}
		
		List<Condition> listCondition = GiveMeWeatherActivity.getHomeCityWeather().getListCondition();
		
		if (listCondition == null)
			return;
		
		ConditionAdapter adapter = new ConditionAdapter(this, listCondition);
		lvListe.setAdapter(adapter);
    }
}
